// 判断是否拥有某个权限
import store from "../../store";

export async function hasPermission(permission) {
    const userInfo =  await store.dispatch("user/getInfo");
    if (!userInfo && !userInfo.permissions) {
        return false;
    }
    console.log(userInfo, 888)
    const permissions = userInfo.permissions;
    return permissions.includes(permission);
}